{extend name="mainadmin@layouts/base" /}
<!-- 引入样式 -->
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
<!-- 引入组件库 -->
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
{block name="main" }
<header class="header  b-b clearfix">
     <div class="page-breadcrumbs">
            <ul class="breadcrumb" >
                <li>
                    <i class="fa fa-ellipsis-v"></i>
                    <strong>商城设置</strong>
                </li>                                  
            </ul>
      </div>
</header>
<section class="scrollable  wrapper">
    <form class="form-horizontal form-validate" method="post" action="{:url('save')}">
        <section class="panel panel-default">
                  <header>
                      <ul class="nav nav-tabs">
                          <li class="active"><a href="#basic" data-toggle="tab">基本配置</a></li>
                          <!--<li ><a href="#return" data-toggle="tab">退货信息</a></li>-->
                          <li><a href="#kdnset" data-toggle="tab">快递鸟配置</a></li>
                      </ul>
                  </header>
                <div class="tab-content">
                    <div class="tab-pane active" id="basic">
                        <!--<div class="form-group">-->
                            <!--<label class="col-sm-2 control-label">首页设定：</label>-->
                            <!--<div class="controls">-->
                                <!--<label class="radio-inline">-->
                                    <!--<input name="shop_index_tpl" value="0" {$setting['shop_index_tpl']==0?'checked':''} type="radio">默认首页-->
                                <!--</label>-->
                                <!--<label class="radio-inline">-->
                                    <!--<input name="shop_index_tpl" value="1" {$setting['shop_index_tpl']==1?'checked':''} type="radio" >自定义首页-->
                                <!--</label>-->
                            <!--</div>-->
                        <!--</div>-->
                        <div class="form-group">
                            <label class="col-sm-2 control-label">商城Title：</label>
                            <div class="controls">
                                <input type="text" name="shop_title"  class="input-large" value="{$setting.shop_title}"> <span class="help-line">首页 - xxxxxxxxxx</span>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">搜索框文字：</label>
                            <div class="controls">
                                <input type="text" name="shop_index_search_text"  class="input-large" data-rule-required="true" value="{$setting.shop_index_search_text}"> <span class="help-line">搜索框默认显示的搜索关键字</span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">热门搜索：</label>
                            <div class="controls">
                                <input type="text" name="hot_search"  class="input-xxlarge" value="{$setting.hot_search}"> <span class="help-line">每个搜索词中间用空格隔开</span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">开放商品评论：</label>
                            <div class="controls">
                                <label class="radio-inline">
                                    <input name="shop_goods_comment" value="0" {$setting['shop_goods_comment']<1?'checked':''} type="radio">关闭
                                </label>
                                <label class="radio-inline">
                                    <input name="shop_goods_comment" value="1" {$setting['shop_goods_comment']==1?'checked':''} type="radio" >开启
                                </label>
                            </div>
                        </div>
                      
                        <script src="https://cdn.bootcss.com/bootstrap-colorpicker/3.0.0-beta.1/js/bootstrap-colorpicker.min.js"></script>
                        <link href="https://cdn.bootcss.com/bootstrap-colorpicker/3.0.0-beta.1/css/bootstrap-colorpicker.min.css" rel="stylesheet">
<style>
    .input-group-addon, .input-group-btn{
        width: 16.66666667%;
        width: 50%;
    }
</style>
                        <form class="form-inline col-md-2">
                            <div class="form-group">
                              <div class="input-group">
                                <div class="input-group-addon">请选择颜色</div>
                                <input type="text" class="form-control" name="systemcolor" name="sss"  id="color" placeholder="#000000">
                              </div>
                            </div>
                          </form>
                   
                          <script>
                            $(function() {
                                $('#color').colorpicker({
                                        allowEmpty:true,//允许为空,显示清楚颜色按钮
                                        color: "{$setting.systemcolor}",//初始化颜色
                                        showInput: true,//显示输入
                                        containerClassName: "full-spectrum",
                                        showInitial: true,//显示初始颜色,提供现在选择的颜色和初始颜色对比
                                        showPalette: true,//显示选择器面板
                                        showSelectionPalette: true,//记住选择过的颜色
                                        showAlpha: true,//显示透明度选择
                                        maxPaletteSize: 7,//记住选择过的颜色的最大数量
                                        preferredFormat: "hex"//输入框颜色格式,(hex十六进制,hex3十六进制可以的话只显示3位,hsl,rgb三原
                                });
                            });
                            </script>



                        <!-- <div class="form-group">
                            <label class="col-sm-2 control-label">开放优惠券：</label>
                            <div class="controls">
                                <label class="radio-inline">
                                    <input name="shop_used_bonus" value="0" {$setting['shop_used_bonus']<1?'checked':''} type="radio">关闭
                                </label>
                                <label class="radio-inline">
                                    <input name="shop_used_bonus" value="1" {$setting['shop_used_bonus']==1?'checked':''} type="radio" >开启
                                </label>
                            </div>
                        </div> -->
                        <div class="form-group hide">
                            <label class="col-sm-2 control-label">开放商品问答：</label>
                            <div class="controls">
                                <label class="radio-inline">
                                    <input name="shop_goods_answer" value="0" {$setting['shop_goods_answer']<1?'checked':''} type="radio">关闭
                                </label>
                                <label class="radio-inline">
                                    <input name="shop_goods_answer" value="1" {$setting['shop_goods_answer']==1?'checked':''} type="radio" >开启
                                </label>
                            </div>
                        </div>
                        <div class="line line-dashed line-lg pull-in"  style="width:99%;"></div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label" >超时取消：</label>
                            <div class="controls">
                                <select name="shop_order_auto_cancel"  style="width:200px;">
                                    <option value="0" {$setting['shop_order_auto_cancel']==0?'selected':''}>不执行自动取消</option>
                                    <option value="15" {$setting['shop_order_auto_cancel']==15?'selected':''}>15 分钟</option>
                                    <option value="30" {$setting['shop_order_auto_cancel']==30?'selected':''}>30 分钟</option>
                                    {for start="1" end="24" name="time" }
                                    <option value="{$time * 60}" {$setting['shop_order_auto_cancel']==$time * 60?'selected':''}>{$time} 小时</option>
                                    {/for}
                                </select> <span class="help-line">下单成功后超过指定时间未支付自动取消订单</span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label" >自动签收：</label>
                            <div class="controls">
                                <select name="shop_auto_sign_limit"  >
                                    {for start="1" end="31" name="day" }
                                    <option value="{$day}" {$setting['shop_auto_sign_limit']==$day?'selected':''}>{$day} 天</option>
                                    {/for}
                                </select> <span class="help-line">发货多少天后订单自动签收</span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label" >快递查询接口：</label>
                            <div class="controls">
                                <select class="input-max" name="shop_shippping_view_fun">
                                    <option value="">选择快递查询接口</option>
                                    {volist name="shippingFunction" id="val"}
                                    <option value="{$val.function}" {$setting['shop_shippping_view_fun'] == $val['function']?'selected':''} >{$val.name}</option>
                                    {/volist}
                                </select>
                            </div>
                        </div>
                        <!--<div class="form-group">-->
                            <!--<label class="col-sm-2 control-label" >申请售后：</label>-->
                            <!--<div class="controls">-->
                                <!--<select name="shop_after_sale_limit"  class="input-max">-->
                                    <!--<option value="0" {$setting['shop_after_sale_limit']==0?'selected':''}>不启用售后功能</option>-->
                                    <!--{for start="1" end="31" name="day" }-->
                                    <!--<option value="{$day}" {$setting['shop_after_sale_limit']==$day?'selected':''}>{$day} 天</option>-->
                                    <!--{/for}-->
                                <!--</select> <span class="help-line">签收后多少天内可申请售后</span>-->
                            <!--</div>-->
                        <!--</div>-->
                        <div class="line line-dashed line-lg pull-in"  style="width:99%;"></div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">减库存的时机：</label>
                            <div class="controls">
                                <label class="radio-inline">
                                    <input name="shop_reduce_stock" value="0" {$setting['shop_reduce_stock']==0?'checked':''} type="radio">下单成功时
                                </label>
                                <label class="radio-inline">
                                    <input name="shop_reduce_stock" value="1" {$setting['shop_reduce_stock']==1?'checked':''} type="radio" >支付成功时
                                </label>
                            </div>
                        </div>

                    </div>
                    <div class="tab-pane " id="return">
                        <div class="form-group">
                            <label class="col-sm-2 control-label">退货收货人：</label>
                            <div class="controls">
                                <input type="text" name="return_consignee" value="{$setting.return_consignee}" class="input-large"> <span class="help-line"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">退货联系电话：</label>
                            <div class="controls">
                                <input type="text" name="return_mobile" value="{$setting.return_mobile}" class="input-large"> <span class="help-line"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">退货地址：</label>
                            <div class="controls">
                                <input type="text" name="return_address" value="{$setting.return_address}" class="input-xxlarge"> <span class="help-line"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">退货说明：</label>
                            <div class="controls">
                               <textarea rows="4" class="input-xxlarge" name="return_desc">{$setting.return_desc}</textarea>
                            </div>
                        </div>
                    </div>
                    <div class="tab-pane" id="kdnset">
                        <div class="form-group">
                            <label class="col-sm-2 control-label" >电商ID（快递鸟）：</label>
                            <div class="controls">
                                <input type="text" name="kdn_appid" value="{$setting.kdn_appid}" style="width: 300px;"> <span class="help-line"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label" >电商加密私钥（快递鸟）：</label>
                            <div class="controls">
                                <input type="text" name="kdn_apikey" value="{$setting.kdn_apikey}" style="width: 300px;"> <span class="help-line"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label" >接口地址（快递鸟）：</label>
                            <div class="controls">
                                <input type="text" name="kdn_apiurl" value="{$setting.kdn_apiurl}" style="width: 300px;">
                                <span class="help-line"></span>
                                <select onchange="$('input[name=kdn_apiurl]').val($(this).val());">
                                    <option value="">请选择接口地址</option>
                                    <option value="http://api.kdniao.com/api/Eorderservice">正式地址</option>
                                    <option value="http://testapi.kdniao.com:8081/api/EOrderService">测试地址</option>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label" >寄件人名称（快递鸟）：</label>
                            <div class="controls">
                                <input type="text" name="kdn_name" value="{$setting.kdn_name}"> <span class="help-line"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label" >联系电话（快递鸟）：</label>
                            <div class="controls">
                                <input type="text" name="kdn_phone" value="{$setting.kdn_phone}"> <span class="help-line"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label" >地区（快递鸟）：</label>
                            <div class="controls">
                                <input type="text" name="kdn_province" class="input-mini" style="text-align: center" value="{$setting.kdn_province}"> <span class="help-line">省</span>
                                <input type="text" name="kdn_city" class="input-mini" style="text-align: center" value="{$setting.kdn_city}"> <span class="help-line">市</span>
                                <input type="text" name="kdn_area" class="input-mini" style="text-align: center" value="{$setting.kdn_area}"> <span class="help-line">区</span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label" >详情地址（快递鸟）：</label>
                            <div class="controls">
                                <input type="text" name="kdn_address" value="{$setting.kdn_address}" style="width: 300px;"> <span class="help-line"></span>
                            </div>
                        </div>
                    </div>
                 </div>
                <div class="line line-dashed line-lg pull-in"  style="width:99%;"></div>
                <div class="form-group">
                    <label class="control-label"></label>
                    <div class="controls">
                        <button type="submit" class="btn btn-primary" data-loading-text="保存中...">保存</button>
                        <button type="button" class="btn btn-default" data-toggle="back">取消</button>
                    </div>
                </div>
          </section>
    </form>
</section>

{/block}
